// pages/indexDetails/indexDetails.js
const app = getApp()
Page({
  /**
   * 页面的初始数据
   */
  data: {
    datas: ""
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let that = this 
    if (typeof options.id != "undefined"){
      wx.request({
        url:app.urlData.getURL + '/index.php/Api/SApi/index/key/' + app.urlData.key +
          '/m/getSlideInfo/wid/' + app.urlData.wid + '/sign/' + wx.getStorageSync('sign'),
        method: 'GET',
        header: {
          'Content-Type': 'application/json'
        },
        data: {
          id: options.id
        },
        success: res => {
          that.setData({
            datas: res.data.datas
          })
        }
      })
    }
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  go(){
    let that = this
    if (that.data.datas.url != ""){
      wx.navigateTo({
        url: that.data.datas.url
      })
    }
  }
})